package cn.lizemin.config;

import cn.lizemin.condition.CatCondition;
import cn.lizemin.condition.DogCondition;
import cn.lizemin.entity.Cat;
import cn.lizemin.entity.Dog;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.stereotype.Component;

/**
 * @author lzm
 * @date 2025/10/1 10:38
 * @description
 */
public class BeanConfig {

    @Bean
    @Conditional(CatCondition.class)
    public Cat cat() {
        Cat cat = new Cat();
        cat.setName("小白");
        cat.setColor("白色");
        return cat;
    }

    @Bean
    @Conditional(DogCondition.class)
    public Dog dog() {
        Dog dog = new Dog();
        dog.setName("大黑");
        dog.setColor("黑色");
        return dog;
    }

}
